package com.jd.controller.center;

import com.jd.bo.AddressBO;
import com.jd.controller.BaseController;
import com.jd.pojo.User;
import com.jd.pojo.UserAddress;
import com.jd.service.AddressService;
import com.jd.service.center.CenterUserService;
import com.jd.utils.JDJSONResult;
import com.jd.utils.MobileEmailUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(value = "center-用户中心",tags = {"用户中心展示相关接口"})
@RestController
@RequestMapping("center")
public class CenterController extends BaseController {

    @Autowired
    private CenterUserService centerUserService;

    @ApiOperation(value = "获取用户信息",notes = "获取用户信息",httpMethod = "GET")
    @GetMapping("/userInfo")
    public JDJSONResult userInfo(@ApiParam(name="userId",value = "用户id",required = true)
                                 @RequestParam String userId){
        if(StringUtils.isBlank(userId)){
            return JDJSONResult.errorMsg("");
        }
        User user= centerUserService.queryUserInfo(userId);
        return JDJSONResult.ok(user);
    }





}
